import 'internal/cache/app_cache.dart';
import 'navigation/app_router.dart';
import 'package:flutter/material.dart';

Future<void> main() async {
  //  这条语句一定要加上，不然会报错，具体原因可以搜一下，这里就不解释了
  WidgetsFlutterBinding.ensureInitialized();
  //  初始化缓存工具类
  await AppCache.init();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.black),
        // useMaterial3: true,
      ),
      routerConfig: AppRouter().router,
    );
  }
}
